import request from "@/api/request.ts";

// 获取系统参数分页数据
export const getConfigListByPage = (
  params: SysConfigRequestParams
): Promise<apiServerResponse> => {
  return request({
    url: "/sysConfig/getListByPage",
    method: "GET",
    params,
  });
};

// 新增系统参数
export const addSysConfigInfo = (
  data: SysConfigEneity
): Promise<apiServerResponse> => {
  return request({
    url: "/sysConfig/add",
    method: "POST",
    data,
  });
};

// 修改系统参数
export const updateSysConfigInfo = (
  data: SysConfigEneity
): Promise<apiServerResponse> => {
  return request({
    url: "/sysConfig/update",
    method: "PUT",
    data,
  });
};

// 删除系统参数
export const deleteSysConfigById = (id: String): Promise<apiServerResponse> => {
  return request({
    url: `/sysConfig/deleteById/${id}`,
    method: "DELETE",
  });
};

// 批量删除系统参数
export const deleteSysConfigByIds = (
  data: String[]
): Promise<apiServerResponse> => {
  return request({
    url: `/sysConfig/deleteByIds`,
    method: "DELETE",
    data,
  });
};
